<%@page import="org.hibernate.validator.constraints.SafeHtml.Tag"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目产品详情</title>
<jsp:include page="../../import.jsp" flush="true" />
<style>
.moreGps{
width:398px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
-ms-border-radius:4px;
-khtml-border-radius:4px;
border-radius:4px;
}
</style>
</head>
<body class="iframeBody" style="padding:0 10px">
	<div class="Wrapper">
		<div>
			<div id="pageInTab" class="pageInTab">
				<form id="basePrdForm1">
					<div tabid="tabA" title="产品基本信息" lselected="true">
						<div class="fieldset1 tabel_col clearFix">
							<div class="caption">
								<span class="title">主车配置</span>
							</div>
							<div style="display: none">
								<input name="mfrId" id="mfrId" type="hidden" value=""
									class="ui-textbox" disabled="disabled">
								<!-- <input name="brCd" id="brCd" type="text"  value=""  class="ui-textbox"  disabled="disabled"> -->
								<input name="prdbscInfoId" id="prdbscInfoId" type="hidden"
									value="" class="ui-textbox" disabled="disabled"> <input
									name="carId" id="carId" type="hidden" value=""
									class="ui-textbox" disabled="disabled"> <input
									name="tkId" id="tkId" type="hidden" value="" class="ui-textbox"
									disabled="disabled"> <input name="prdId" id="prdId"
									type="hidden" value="${prjPrd.prdId}"
									class="ui-textbox" disabled="disabled"> <input
									name="detailId" id="detailId" type="hidden" value=""
									class="ui-textbox" disabled="disabled">
									<input name="lnkCompId" id ="lnkCompId" type="hidden"
									 value="${dtlVO.lnkCompId}" class="ui-textbox" disabled="disabled">
								
							</div>
							<c:if test="${prdTypCd == 008001 }">
							<div  class="fieldBox col_33" id= "GK">
								<div class="label" style="width:40%">挂靠公司</div>
								<div class="field" style="padding-left:41%">
								<input id = "lnkCompNm" name = "lnkCompNm" type="text" class="ui-textbox" value="${dtlVO.lnkCompNm}">
								<span id="searchBtn"  onclick = "searchBtn();"class="sq-button sq-button-hasicon"><i class="sqBtnIco_1"></i>查询</span>
								</div>
							</div>
							</c:if>
							<div class="fieldBox col_33" id="CPName">
								<div class="label" style="width:40%">产品名称</div>
								<div class="field" style="padding-left:41%">
									<input name="prdNm" id="prdNm" type="text"
										value="${dtlVO.prdNm}" class="ui-textbox" readonly="readonly">
								</div>
							</div>
							<div class="fieldBox col_33" id="CPType">
								<div class="label" style="width:40%">产品类型</div>
								<div class="field" style="padding-left:41%">
									<input name="prdTypNm" id="prdTypNm" type="text"
										 value="${prdTypNm}" class="ui-textbox" readonly="readonly" >
									<!-- 	<span id="findprdTypNm"  onclick = "findprdTypNm();"class="sq-button sq-button-hasicon"><i class="sqBtnIco_1"></i>查询</span> -->
								</div>
							</div>
							<div class="fieldBox col_33" id="CPBrand">
								<div class="label" style="width:40%">产品品牌</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="brCd" name="brCd" value="${prjPrd.brCd}"
										class="ui-textbox" readonly="readonly">
								</div>
							</div>
							<div class="fieldBox col_33" style="display:none" id="Car1">
								<div class="label" style="width:40%">车系</div>
								<div class="field" style="padding-left:41%">
									<input name="prdMdl" id="prdMdl" type="text"
										value="${prjPrd.prdMdl}" class="ui-textbox"
										readonly="readonly">
								</div>
							</div>
							<c:if test="${prdTypCd == 008001 }">
							<div class="fieldBox col_33" id= "Car2">
								<div class="label" style="width:40%">车辆型号</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="dtlprdMdl" name="dtlprdMdl"
										value="${dtlVO.prdMdl}" class="ui-textbox" validate="{required:true}">
								<span class="requiredSymbol">*</span>
								<span id="finddtlPrdMdl"  onclick = "finddtlPrdMdl();"class="sq-button sq-button-hasicon"><i class="sqBtnIco_1"></i>查询</span>
								</div>
							</div>
							</c:if>
							<c:if test="${prdTypCd != 008001 }">
							<div class="fieldBox col_33" id= "Car2">
								<div class="label" style="width:40%">车辆型号</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="dtlprdMdl" name="dtlprdMdl"
										value="${dtlVO.prdMdl}" class="ui-textbox" validate="{required:true}">
								<span class="requiredSymbol">*</span>
								</div>
							</div>
							</c:if>
							
							<c:if test="${prdTypCd == 008001 }">
							<div class="fieldBox col_33" id="Car3">
								<div class="label" style="width:40%">座位数</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="seatQtyCd" readonly="readonly"  name="seatQtyCd"  class="ui-textbox" value="${cvo.seatQtyCd}">
								</div>
							</div>
							<div class="fieldBox col_33" id="Car4">
								<div class="label" style="width:40%">车身长度</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="carLen" readonly="readonly" name="carLen"  class="ui-textbox" value="${cvo.carLen }">
								</div>
							</div>
							</c:if>
							<div class="fieldBox col_33" id="Car5">
								<div class="label" style="width:40%">车架号</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="vin" name="vin" value="${dtlVO.vin}"
										class="ui-textbox" validate="{required:true}" onblur="validateVin(this)">
									<input name="vinValidRes"  id="vinValidRes" type="hidden" class="ui-textbox" value="${dtlVO.vinValidRes}" validate="{required:true}">
									<span class="requiredSymbol">*</span>
									<span class="requiredSymbol" id="vinValidationResult">${dtlVO.vinValidResNm}</span>
								</div>
							</div>
							<c:if test="${prdTypCd != 008001 }">
							<div class="fieldBox col_33" id="isHide" style="display:none">
								<div class="label" style="width:40%">发动机型号</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="engMdl" name="engMdl"
										value="${dtlVO.engMdl}" class="ui-textbox" readonly="readonly">
								</div>
							</div>
							</c:if>
							<c:if test="${prdTypCd == 008001 }">
							<div class="fieldBox col_33" id="isHides" >
								<div class="label" style="width:40%">发动机型号</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="engMdl" name="engMdl"
									value="${cvo.engMdl}" class="ui-textbox" >
								</div>
							</div>
							</c:if>
							<div class="fieldBox col_33" id="isEngNo">
								<div class="label" style="width:40%">发动机号</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="engNo" name="engNo"
										value="${dtlVO.engNo}" class="ui-textbox" validate="{required:true}">
									<span class="requiredSymbol" id="unReq">*</span>
								</div>
							</div>
							<c:if test="${prdTypCd != 008001 }"><!-- //如果不是专车 -->
							<div class="fieldBox col_33" id ="gps1">
								<div class="label" style="width:40%">GPS卡号1</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="gpsCardNo" name="gpsCardNo"
										value="${dtlVO.gpsCardNo}" class="ui-textbox" validate="{required:true}"><!-- validate="{required:true}" -->
								<span class="requiredSymbol">*</span>
								</div>
							</div>
							</c:if>
							<c:if test="${prdTypCd == 008001 }">
							<div class="fieldBox col_33" id ="gps3">  <!-- 只适用于专车 -->
								<div class="label" style="width:40%">GPS卡号1</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="gpsCardNo" name="gpsCardNo"
										value="${dtlVO.gpsCardNo}" class="ui-textbox"  ><!-- validate="{required:true}" readonly="readonly" -->
								<span class="requiredSymbol">*</span>
								</div>
								
							</div>
							</c:if>
							<div class="fieldBox col_33" id="type1" >
								<div class="label" style="width:40%">GPS类型1</div>
								<div class="field" style="padding-left:41%">
								<select id="gpsTypCd" name="gpsTypCd"   ><!-- validate="{required:true}" -->
									<option value=" " >请选择</option>
									<c:forEach items="${gpsTypList}" var="gpsTyps">
										<option value="${gpsTyps.key }">${gpsTyps.value }</option>
									</c:forEach>
								</select>
								<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_33" id="mfr1" >
								<div class="label" style="width:40%">GPS厂家1</div>
								<div class="field" style="padding-left:41%">
								<select id="gpsMfr" name="gpsMfr" ><!-- validate="{required:true}" -->
									<option value=" ">请选择</option>
									<c:forEach items="${gpsNmList}" var="gpsNms">
										<option  value="${gpsNms.key }">${gpsNms.value }</option>
									</c:forEach>
								</select>
								<span class="requiredSymbol">*</span>
								</div>
							</div>
							<div class="fieldBox col_33" id ="gps2">
								<div class="label" style="width:40%">GPS卡号2</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="gpsCardNo2" name="gpsCardNo2"
										value="${dtlVO.gpsCardNo2}" class="ui-textbox">
								</div>
							</div>
							<div class="fieldBox col_33" id="type2">
								<div class="label" style="width:40%">GPS类型2</div>
								<div class="field" style="padding-left:41%">
								<select id="gpsTypCd2" name="gpsTypCd2">
									<option value=" ">请选择</option>
									<c:forEach items="${gpsTypList}" var="gpsTyps">
										<option value="${gpsTyps.key }">${gpsTyps.value }</option>
									</c:forEach>
								</select>
								</div>
							</div>
							<div class="fieldBox col_33" id="mfr2">
								<div class="label" style="width:40%">GPS厂家2</div>
								<div class="field" style="padding-left:41%">
								<select id="gpsMfr2" name="gpsMfr2">
									<option value=" ">请选择</option>
									<c:forEach items="${gpsNmList}" var="gpsNms">
										<option value="${gpsNms.key }">${gpsNms.value }</option>
									</c:forEach>
								</select>
								</div>
							</div>
							<div class="fieldBox col_33" id ="gps3">
								<div class="label" style="width:40%">GPS卡号3</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="gpsCardNo3" name="gpsCardNo3"
										   value="${dtlVO.gpsCardNo3}" class="ui-textbox">
								</div>
							</div>
							<div class="fieldBox col_33" id="type3">
								<div class="label" style="width:40%">GPS类型3</div>
								<div class="field" style="padding-left:41%">
										<input type="text" id="gpsTypCd3" name="gpsTypCd3"
											   value="${dtlVO.gpsTypCd3}" class="ui-textbox">
								</div>
							</div>
							<div class="fieldBox col_33" id="mfr3">
								<div class="label" style="width:40%">GPS厂家3</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="gpsMfr3" name="gpsMfr3"
										   value="${dtlVO.gpsMfr3}" class="ui-textbox">
								</div>
							</div>
							<div class="fieldBox col_33" id ="licenseNum_div">
								<div class="label" style="width:40%">车牌号</div>
								<div class="field" style="padding-left:41%">
									<input type="text" id="licenseNum_input" name="licenseNum"
										   value="${dtlVO.vehNo}" class="ui-textbox">
								</div>
							</div>
							<div class="fieldBox col_33" id="install">
								<div class="label" style="width:40%">GPS是否安装</div>
								<div class="field" style="padding-left:41%">
								<select id= "gpsInstall" name ="gpsInstall" value="${dtlVO.gpsInstall}">
								<option value= "">请选择</option>
								<option value= "1"  >是</option>
								<option value= "0"  >否</option>
								</select>
								</div>	
							</div>
							<div  class="fieldBox col_33 install_usr" id="install_usr">
								<div  class="label" style="width:40%">GPS安装人</div>
								<div  class="field" style="padding-left:41%">
								<select id= "gpsInstallUsr" name="gpsInstallUsr" value="${dtlVO.gpsInstallUsr}">
								<option value="">请选择</option>
								<option value= "2">厂商</option>
								<option value= "3">客户经理</option>
								</select>
								</div>
							</div>
						</div>
					</div>
					<%--<div id="btnsBox" class="btnsBox">--%>
						<%--<span id="moreBtn" class="sq-button sq-button-round"--%>
							<%--onclick="moreGps();" style="display:none">更多GPS卡号--%>
						<%--</span>--%>
					<%--</div>--%>
					<%--<div class="fieldset1 tabel_col clearFix" id="moreGps">--%>
							<%--<span id="addGps" style="display:none" class="sq-button sq-button-round" onclick="addGps();" >新增GPS卡号</span>--%>
							<%--<c:forEach items="${moreGpsList}" var="item">--%>
							<%--<div class="fieldBox col_100">--%>
								<%--<div class="label" style="width:13.5%;padding-left:2%">--%>
								<%--GPS卡号</div>--%>
								<%--<div class="field" style="padding-left:15%;width:58%">--%>
										<%--<input type="text" id="gpsCardNoMore" name="gpsCardNoMore"--%>
										<%--value="${item.gpsCardNo}" class="moreGps">--%>
								<%--</div>--%>
								<%--<span id="deleteButton" class="sq-button-hasicon onlyicon deleteButton" onclick="deleteGps(this);" ><i class="sqBtnIco_7"></i></span>--%>
							<%--</div>--%>
							<%--</c:forEach>--%>
					<%--</div>--%>
					<div id="btnsBox" class="btnsBox">
						<span id="saveBtn" class="sq-button sq-button-round"
							onclick="savePrjBscInfo()">
							<!-- <i class="sqBtnIco_10"></i> -->保存
						</span> <span id="cancelBtn" class="sq-button sq-button-round"
							onclick="cancelBtn()">
							<!-- <i class="sqBtnIco_14"></i> -->取消
						</span>
					</div>
				</form>
			</div>
		</div>
	</div>
	<script type="text/javascript">
var dtlId = '${dtlId}';//产品明细ID
var prdTypNm = '${prdTypNm}';//产品名称
var detailFlag = '${detailFlag}'; //
var prdTypCd = '${prdTypCd}';//产品分类 
var isMust = '${isMust}'; 
var isShow = 0;
var gpsInstall = '${dtlVO.gpsInstall}';//是否安装
var Caralter = "${Caralter}";
var projectApproval = "${projectApproval}";
var ZCdetail = "${ZCdetail}";
var taskDefKey = "${taskDefKey}";//商助GPS审核节点
$(function () {
    // 车牌号默认隐藏，只有查看详情时，才展示
    $("#licenseNum_div").hide();


	/* -------------tsn---------------------------- */
	if((isMust == "" ||isMust == "false") && detailFlag =="false" && prdTypCd =="008001" && (projectApproval == '0' || ZCdetail =="true")){//专车项目 
		$("#install").hide();
		$("#gps3").hide();
		$("#type1").hide();
		$("#mfr1").hide();
		$("#gps2").hide();
		$("#type2").hide();
		$("#mfr2").hide();
		$("#mfr3").hide();
        $("#type3").hide();
		$("#install_usr").hide();
		
		
	}
	
	if( prdTypCd =="008001" && Caralter=='1' && detailFlag =="false" && (taskDefKey == "FLOW_00000008_002_002_002" ||taskDefKey == "FLOW_00000008_007_002_010" ) ){//商助维护gps
		$("#install").show();
		$("#gps3").show();
		$("#type1").show();
		$("#mfr1").show();
		$("#gps2").show();
		$("#type2").show();
		$("#mfr2").show();
		$("#GK").hide();
		$("#CPName").hide();
		$("#CPType").hide();
		$("#CPBrand").hide();
		$("#Car1").hide();
		$("#Car2").hide();
		$("#Car3").hide();
		$("#Car4").hide();
		$("#Car5").hide();
		$("#isHides").hide();
		$("#isHide").hide();
		$("#isEngNo").hide();
		
	}
	if(isMust == "false"){
		$("#install").hide();
	}
	//GPS安装人在加载页面时先隐藏--tiansainan
	var s = $("#gpsInstallUsr").val();
	if(s != ""){
		$(".install_usr").show();
	}else{
		$(".install_usr").hide();
	}
	//根据是否安装-展示安装人
	 if(gpsInstall == 1){
		$("#install_usr").show();
	}else{
		$("#install_usr").hide();
	}  
if(taskDefKey != "FLOW_00000008_002_002_002" ||taskDefKey != "FLOW_00000008_007_002_010"){
	$("#install_usr").hide();
}
	isMustOption();
	 var basePrdForm1 = liger.get("basePrdForm1");
		var form = $("#basePrdForm1").ligerForm({
			validate: true
	    });
		var form = new liger.get("basePrdForm1");
		form.setData({
			gpsTypCd : '${dtlVO.gpsTypCd}',//GPS类型1
			gpsMfr : '${dtlVO.gpsMfr}',//GPS厂商1
			gpsTypCd2 : '${dtlVO.gpsTypCd2}',//GPS类型2
			gpsTypCd3 : '${dtlVO.gpsTypCd3}',//GPS类型3
			gpsMfr2 : '${dtlVO.gpsMfr2}',//GPS厂商2
			gpsMfr3 : '${dtlVO.gpsMfr3}',//GPS厂商3
			gpsInstall : '${dtlVO.gpsInstall}',//是否安装
			gpsInstallUsr : '${dtlVO.gpsInstallUsr}'//安装人
		});
		var isCon = prdTypCd.substring(0,3);
		if(isCon!="007"&&isCon!="008"){
			if(liger.get("dtlprdMdl")&&liger.get("dtlprdMdl")!="undefined"){//车辆型号
				liger.get("dtlprdMdl").setDisabled(true);
			}
			if(isCon!="007"&&isCon!="008"&&isCon!="019"&&isCon!="020"&&isCon!="021"){
//				$("#addGps").show();
				$("#type1").hide();
				$("#type2").hide();
				$("#type3").hide();
				$("#mfr1").hide();
				$("#mfr2").hide();
				$("#mfr3").hide();
				$("#isHide").show();
			}
			//$("#moreBtn").show();
			
		}
		if(detailFlag=="true"){//查看功能时
			$("#saveBtn").hide();//保存隐藏
			$("#cancelBtn").hide();//取消隐藏
			$("span[id='deleteButton']").each(function(){
				$(this).hide();
			});

            $("#licenseNum_div").show(); // 车牌号展示
            if(liger.get("licenseNum_input")&&liger.get("licenseNum_input")!="undefined"){
                liger.get("licenseNum_input").setDisabled(true);
            }

			if(liger.get("dtlprdMdl")&&liger.get("dtlprdMdl")!="undefined"){
				liger.get("dtlprdMdl").setDisabled(true);
			}
			if(liger.get("engMdl")&&liger.get("engMdl")!="undefined"){
				liger.get("engMdl").setDisabled(true);
			}
			if(liger.get("engNo")&&liger.get("engNo")!="undefined"){
				liger.get("engNo").setDisabled(true);
			}
			if(liger.get("vin")&&liger.get("vin")!="undefined"){
				liger.get("vin").setDisabled(true);
			}
			if(liger.get("gpsCardNo")&&liger.get("gpsCardNo")!="undefined"){
				liger.get("gpsCardNo").setDisabled(true);
			}
			if(liger.get("gpsCardNo2")&&liger.get("gpsCardNo2")!="undefined"){
				liger.get("gpsCardNo2").setDisabled(true);
			}
			if(liger.get("gpsCardNo3")&&liger.get("gpsCardNo3")!="undefined"){
				liger.get("gpsCardNo3").setDisabled(true);
			}
			if(liger.get("gpsTypCd")&&liger.get("gpsTypCd")!="undefined"){
				liger.get("gpsTypCd").setDisabled(true);
			}
			if(liger.get("gpsTypCd2")&&liger.get("gpsTypCd2")!="undefined"){
				liger.get("gpsTypCd2").setDisabled(true);
			}
			if(liger.get("gpsTypCd3")&&liger.get("gpsTypCd3")!="undefined"){
				liger.get("gpsTypCd3").setDisabled(true);
			}
			if(liger.get("gpsMfr")&&liger.get("gpsMfr")!="undefined"){
				liger.get("gpsMfr").setDisabled(true);
			}
			if(liger.get("gpsMfr2")&&liger.get("gpsMfr2")!="undefined"){
				liger.get("gpsMfr2").setDisabled(true);
			}
			if(liger.get("gpsMfr3")&&liger.get("gpsMfr3")!="undefined"){
				liger.get("gpsMfr3").setDisabled(true);
			}
			if(liger.get("gpsInstall")&&liger.get("gpsInstall")!="undefined"){
				liger.get("gpsInstall").setDisabled(true);
			}
			if(liger.get("gpsInstallUsr")&&liger.get("gpsInstallUsr")!="undefined"){
				liger.get("gpsInstallUsr").setDisabled(true);
			}
			if(liger.get("lnkCompNm")&&liger.get("lnkCompNm")!="undefined"){
				liger.get("lnkCompNm").setDisabled(true);
			}
			
		}
		if(prdTypCd =="008001"){
			if(liger.get("lnkCompNm")&&liger.get("lnkCompNm")!="undefined"){
				liger.get("lnkCompNm").setDisabled(true);
			}
			
			if(liger.get("dtlprdMdl")&&liger.get("dtlprdMdl")!="undefined"){
				liger.get("dtlprdMdl").setDisabled(true);
			}
		}
		
})

	function isMustOption(){
	var isCon = prdTypCd.substring(0,3);
	if(isCon=="019"||isCon=="020"||isCon=="021"){
		$("#isEngNo").hide();
		$("#engNo").attr("validate","");//设置属性值
		$("span[id='unReq']").remove();
	}
	if(isMust=="false"){
		$("#dtlprdMdl").attr("validate","");
		$("#engMdl").attr("validate","");
		$("#engNo").attr("validate","");
		$("#gpsCardNo").attr("validate","");
		$("#vin").attr("validate","");
		$("span[class='requiredSymbol']").remove();
		}
	}
  

	//添加产品类型（车辆型号）  tiansainan
	function finddtlPrdMdl () {
		var callback = function () {
			grid.reload();
		}
		if(dtlId.length <1){
			$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_SELECT_ONLY_A_ROW, SQ_type: "warring"});
			return ;
		}
		var prdNm = $("#prdNm").val();
		 $.ligerDialog.open({  title: '添加产品车辆类型',height: 500,width: 850, url:'<%=path%>/project/prjprddtl/toChoosePrdListPage.do?dtlId='+dtlId+'&prdTypCd='+prdTypCd+'&prdNm='+prdNm,callback:callback});

	}
	//添加挂靠公司  tiansainan
	 function searchBtn () {
		var callback = function(){
			 grid.reload();
		}
		if(dtlId.length <1){
			$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_SELECT_ONLY_A_ROW, SQ_type: "warring"});
			return;
		}
		  $.ligerDialog.open({  title: '添加产品挂靠公司',height: 500,width: 850, url:'<%=path%>/project/prjprddtl/toChooseLnkCompPage.do?dtlId='+dtlId,callback:callback});

	}
	//GPS安装人选择  tiansainan
	$(function(){
		$("#gpsInstall").change(function(){
			if($(this).val() == 1){
				$(".install_usr").show();
				
			}else{
				$(".install_usr").hide();
			}
		})
	})
  //取消
	function cancelBtn(){
		  /* var TAB=top.mainApp.parentTab;
          var currentTabid=TAB,
          .getSelectedTabItemID();
		 top.tab.removeTabItem(currentTabid); */
	//parent.grid.reload();
	//parent.$.ligerDialog.close();
	//取消关闭tab页面  tiansainan
	top.tab.removeTabItem('tab_prj_prd_dtl_info'+dtlId);
	parent.$(".l-dialog,.l-window-mask").css("display","none");
	}
  
	//保存项目基础信息
	function savePrjBscInfo(){
        var ligerForm = liger.get("basePrdForm1");
        if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        var params = {};
        params.engMdl = $("#engMdl").val();
        params.engNo = $("#engNo").val();
        params.prdMdl =  $("#dtlprdMdl").val();
        params.vin =  $("#vin").val();
        params.gpsCardNo = $("#gpsCardNo").val();
        params.gpsCardNo2 =  $("#gpsCardNo2").val();
        params.gpsTypCd = $("#gpsTypCd").val();
        params.gpsTypCd2 =  $("#gpsTypCd2").val();
        params.gpsMfr = $("#gpsMfr").val();
        params.gpsMfr2 =  $("#gpsMfr2").val();
        params.gpsMfr3 =  $("#gpsMfr3").val();
        params.gpsInstall =  $("#gpsInstall").val();
        params.gpsInstallUsr =  $("#gpsInstallUsr").val();
        params.seatQtyCd =  $("#seatQtyCd").val();//座位数
        params.carLen =  $("#carLen").val();//车身长度
        params.lnkCompNm =  $("#lnkCompNm").val();//挂靠公司
        params.lnkCompId =  $("#lnkCompId").val();//挂靠公司ID
        params.prdId =  $("#prdId").val();
        params.dtlId = dtlId;  
        params.Caralter = Caralter;
        params.vinValidRes = $("#vinValidRes").val();
        var moreGpsStr = "";
        $("#moreGps input").each(function(){
        	if($(this).val()!=""){
        		moreGpsStr +=$(this).val()+",";
        	}
		});
        params.moreGps = moreGpsStr;
        var url = '<%=path%>/project/prjprddtl/modifyPrdDtlCarPrdInfo.do';
        var wait_dialog;
        $.ajax({
    		type: 'post',
    		dataType:'json',
    		data:params,
    		url: url,
    		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    				 wait_dialog.close();
    			 if(msg.success == 1){
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
    					 var TAB=top.mainApp.parentTab;
			            var currentTabid=TAB.getSelectedTabItemID();
			            var currFrameElement=top.$("#"+currentTabid).get(0);
						 var callback=currFrameElement.W2W.callback;
		          	  		callback();
		          	 	 top.tab.removeTabItem(currentTabid); 
    				 	grid.reload();
		          	 	 //关闭tab页    tiansainan
		          	 	 parent.$("#searchBtn1").click();//刷新父页面
		          	 	top.tab.removeTabItem('tab_prj_prd_dtl_info'+dtlId);
		          	 	
						parent.$(".l-dialog,.l-window-mask").css("display","none"); 
    			 }else{
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
    			 }
    		}
    	});
	}
function validateVin(input){
    var vin = $(input).val();
    if(StringUtils.isEmpty(vin)){
        $("#vinValidationResult").html("未校验");
        $("#vinValidRes").val("0");
    }else {
        $.ajax({
            type: 'get',
            dataType: 'json',
            data: {vin: vin},
            url: '<%=path%>/project/prjprddtl/validVin.do',
            success: function (msg) {
                $("#vinValidRes").val(msg.success);
                $("#vinValidationResult").html(msg.info);
            }
        });
    }
}
</script>
	<div class="ClearLine"></div>
</body>
</html>
